using System;
using System.Collections.Generic;
using System.Text;

namespace Buoi02
{
    class CNhanVien
    {
        #region Fields
        protected string m_HoTen;
        protected DateTime m_NgaySinh;
        protected string m_DiaChi;
        #endregion

        #region Contructors
        public CNhanVien()
        {
            m_HoTen = null;
            m_NgaySinh = DateTime.Now;
            m_DiaChi = null;
        }

        public CNhanVien(string ht, DateTime ns, string dc)
        {
            m_HoTen = ht;
            m_NgaySinh = ns;
            m_DiaChi = dc;
        }
        #endregion

        #region Properties
        public string HoTen
        {
            get { return m_HoTen; }
            set { m_HoTen = value; }
        }

        public DateTime NgaySinh
        {
            get { return m_NgaySinh; }
            set { m_NgaySinh = value; }
        }

        public string DiaChi
        {
            get { return m_DiaChi; }
            set { m_DiaChi = value; }
        }
        #endregion

        #region Methods
        public virtual void Nhap()
        {
            Console.Write("Ho va ten   : ");
            m_HoTen = Console.ReadLine();

            Console.Write("Ngay sinh   : ");
            m_NgaySinh = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Dia chi     : ");
            m_DiaChi = Console.ReadLine();
        }

        public virtual void Xuat()
        {
            Console.WriteLine("Ho va ten   : {0}", m_HoTen);
            Console.WriteLine("Ngay sinh   : {0}", m_NgaySinh);
            Console.WriteLine("Dia chi     : {0}", m_DiaChi);
        }

        public virtual double TinhLuong()
        {
            return 0;
        }
        #endregion
    }

    class CNVSanXuat : CNhanVien
    {
        #region Field
        int m_SoSanPham;
        #endregion

        #region Contructors
        public CNVSanXuat()
            : base()
        {
            m_SoSanPham = 0;
        }

        public CNVSanXuat(string ht, DateTime ns, string dc, int ssp)
            : base(ht, ns, dc)
        {
            m_SoSanPham = ssp;
        }
        #endregion

        #region Properties
        public int SoSanPham
        {
            get { return m_SoSanPham; }
            set { m_SoSanPham = value; }
        }
        #endregion

        #region Methods
        public override void Nhap()
        {
            base.Nhap();

            Console.Write("So san pham : ");
            m_SoSanPham = Convert.ToInt32(Console.ReadLine());
        }

        public override void Xuat()
        {
            base.Xuat();

            Console.WriteLine("So san pham : {0}", m_SoSanPham);
            Console.WriteLine("Luong       : {0}", TinhLuong());
        }

        public override double TinhLuong()
        {
            return m_SoSanPham * 2000;
        }
        #endregion
    }

    class CNVCongNhat : CNhanVien
    {
        #region Field
        int m_SoNgayCong;
        #endregion

        #region Contructors
        public CNVCongNhat()
            : base()
        {
            m_SoNgayCong = 0;
        }

        public CNVCongNhat(string ht, DateTime ns, string dc, int snc)
            : base(ht, ns, dc)
        {
            m_SoNgayCong = snc;
        }
        #endregion

        #region Properties
        public int SoNgayCong
        {
            get { return m_SoNgayCong; }
            set { m_SoNgayCong = value; }
        }
        #endregion

        #region Methods
        public override void Nhap()
        {
            base.Nhap();

            Console.Write("So ngay cong: ");
            m_SoNgayCong = Convert.ToInt32(Console.ReadLine());
        }

        public override void Xuat()
        {
            base.Xuat();

            Console.WriteLine("So ngay cong: {0}", m_SoNgayCong);
            Console.WriteLine("Luong       : {0}", TinhLuong());
        }

        public override double TinhLuong()
        {
            return m_SoNgayCong * 50000;
        }
        #endregion
    }

    class CNVQuanLy : CNhanVien
    {
        #region Fields
        float m_HeSoLuong;
        double m_LuongCoBan;
        #endregion

        #region Contructors
        public CNVQuanLy()
            : base()
        {
            m_HeSoLuong = 0;
            m_LuongCoBan = 0;
        }

        public CNVQuanLy(string ht, DateTime ns, string dc, float hsl, double lcb)
            : base(ht, ns, dc)
        {
            m_HeSoLuong = hsl;
            m_LuongCoBan = lcb;
        }
        #endregion

        #region Properites
        public float HeSoLuong
        {
            get { return m_HeSoLuong; }
            set { m_HeSoLuong = value; }
        }

        public double LuongCoBan
        {
            get { return m_LuongCoBan; }
            set { m_LuongCoBan = value; }
        }
        #endregion

        #region Methods
        public override void Nhap()
        {
            base.Nhap();

            Console.Write("He so luong : ");
            m_HeSoLuong = Convert.ToSingle(Console.ReadLine());

            Console.Write("Luong co ban: ");
            m_LuongCoBan = Convert.ToDouble(Console.ReadLine());
        }

        public override void Xuat()
        {
            base.Xuat();

            Console.WriteLine("He so luong : {0}", m_HeSoLuong);
            Console.WriteLine("Luong co ban: {0}", m_LuongCoBan);
            Console.WriteLine("Luong       : {0}", TinhLuong());
        }

        public override double TinhLuong()
        {
            return m_LuongCoBan * m_HeSoLuong;
        }
        #endregion
    }
}